package com.mj.haier.calc.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import org.springframework.data.elasticsearch.annotations.Document;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;

/**
 * SettlementProcessInfo.
 * @author ycm
 */
@ApiModel(description = "SettlementProcessInfo. @author ycm")
@Entity
@Table(name = "settlement_process_info")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "settlementprocessinfo")
public class SettlementProcessInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 结算周期, 如 201901
     */
    @NotNull
    @ApiModelProperty(value = "结算周期, 如 201901", required = true)
    @Column(name = "settlement_cycle", nullable = false)
    private String settlementCycle;

    /**
     * 业务订单号，按照结算维度唯一
     */
    @NotNull
    @ApiModelProperty(value = "业务订单号，按照结算维度唯一", required = true)
    @Column(name = "order_code", nullable = false, unique = true)
    private String orderCode;

    /**
     * 订单总金额，单位（分）
     */
    @NotNull
    @ApiModelProperty(value = "订单总金额，单位（分）", required = true)
    @Column(name = "order_amounts", nullable = false)
    private Integer orderAmounts;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "gmt_create")
    private Instant gmtCreate;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Column(name = "create_user")
    private String createUser;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @Column(name = "gmt_modified")
    private Instant gmtModified;

    /**
     * 修改人
     */
    @ApiModelProperty(value = "修改人")
    @Column(name = "modified_user")
    private String modifiedUser;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Column(name = "remarks")
    private String remarks;

    /**
     * 备用字段
     */
    @ApiModelProperty(value = "备用字段")
    @Column(name = "add_1")
    private String add1;

    @Column(name = "add_2")
    private String add2;

    @Column(name = "add_3")
    private String add3;

    @Column(name = "add_4")
    private String add4;

    @Column(name = "add_5")
    private String add5;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSettlementCycle() {
        return settlementCycle;
    }

    public SettlementProcessInfo settlementCycle(String settlementCycle) {
        this.settlementCycle = settlementCycle;
        return this;
    }

    public void setSettlementCycle(String settlementCycle) {
        this.settlementCycle = settlementCycle;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public SettlementProcessInfo orderCode(String orderCode) {
        this.orderCode = orderCode;
        return this;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Integer getOrderAmounts() {
        return orderAmounts;
    }

    public SettlementProcessInfo orderAmounts(Integer orderAmounts) {
        this.orderAmounts = orderAmounts;
        return this;
    }

    public void setOrderAmounts(Integer orderAmounts) {
        this.orderAmounts = orderAmounts;
    }

    public Instant getGmtCreate() {
        return gmtCreate;
    }

    public SettlementProcessInfo gmtCreate(Instant gmtCreate) {
        this.gmtCreate = gmtCreate;
        return this;
    }

    public void setGmtCreate(Instant gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getCreateUser() {
        return createUser;
    }

    public SettlementProcessInfo createUser(String createUser) {
        this.createUser = createUser;
        return this;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Instant getGmtModified() {
        return gmtModified;
    }

    public SettlementProcessInfo gmtModified(Instant gmtModified) {
        this.gmtModified = gmtModified;
        return this;
    }

    public void setGmtModified(Instant gmtModified) {
        this.gmtModified = gmtModified;
    }

    public String getModifiedUser() {
        return modifiedUser;
    }

    public SettlementProcessInfo modifiedUser(String modifiedUser) {
        this.modifiedUser = modifiedUser;
        return this;
    }

    public void setModifiedUser(String modifiedUser) {
        this.modifiedUser = modifiedUser;
    }

    public String getRemarks() {
        return remarks;
    }

    public SettlementProcessInfo remarks(String remarks) {
        this.remarks = remarks;
        return this;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getAdd1() {
        return add1;
    }

    public SettlementProcessInfo add1(String add1) {
        this.add1 = add1;
        return this;
    }

    public void setAdd1(String add1) {
        this.add1 = add1;
    }

    public String getAdd2() {
        return add2;
    }

    public SettlementProcessInfo add2(String add2) {
        this.add2 = add2;
        return this;
    }

    public void setAdd2(String add2) {
        this.add2 = add2;
    }

    public String getAdd3() {
        return add3;
    }

    public SettlementProcessInfo add3(String add3) {
        this.add3 = add3;
        return this;
    }

    public void setAdd3(String add3) {
        this.add3 = add3;
    }

    public String getAdd4() {
        return add4;
    }

    public SettlementProcessInfo add4(String add4) {
        this.add4 = add4;
        return this;
    }

    public void setAdd4(String add4) {
        this.add4 = add4;
    }

    public String getAdd5() {
        return add5;
    }

    public SettlementProcessInfo add5(String add5) {
        this.add5 = add5;
        return this;
    }

    public void setAdd5(String add5) {
        this.add5 = add5;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SettlementProcessInfo settlementProcessInfo = (SettlementProcessInfo) o;
        if (settlementProcessInfo.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), settlementProcessInfo.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "SettlementProcessInfo{" +
            "id=" + getId() +
            ", settlementCycle='" + getSettlementCycle() + "'" +
            ", orderCode='" + getOrderCode() + "'" +
            ", orderAmounts=" + getOrderAmounts() +
            ", gmtCreate='" + getGmtCreate() + "'" +
            ", createUser='" + getCreateUser() + "'" +
            ", gmtModified='" + getGmtModified() + "'" +
            ", modifiedUser='" + getModifiedUser() + "'" +
            ", remarks='" + getRemarks() + "'" +
            ", add1='" + getAdd1() + "'" +
            ", add2='" + getAdd2() + "'" +
            ", add3='" + getAdd3() + "'" +
            ", add4='" + getAdd4() + "'" +
            ", add5='" + getAdd5() + "'" +
            "}";
    }
}
